﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Ccit.Utils;
using System.Collections.Generic;
using Ccit.OA.MsSystemDoc;
namespace Ccit.OA.SystemDoc
{
    public interface ISystemDoc
    {
        /// <summary>
        /// 获取类别树根节点名称
        /// </summary>
        /// <param name="sClassType"></param>
        /// <returns></returns>
        string GetSysDocNode(string sClassType, string swhereClause);
        /// <summary>
        /// 获取菜单树信息
        /// </summary>
        /// <returns></returns>
        string GetSysDocNodes(string sClassType, string swhereClause);
        /// <summary>
        /// 获取菜单树子节点信息
        /// </summary>
        /// <param name="SysDocId"></param>
        /// <returns></returns>
        List<MsSecondClass> GetSysDocNodesXML(string SysDocId, string sClassType, string swhereClause);
        /// <summary>
        /// 删除节点信息
        /// </summary>
        /// <param name="SysDocId"></param>
        /// <returns></returns>
        List<string> DeleteSysDocMess(string SysDocId);
        /// <summary>
        /// 获取编辑页面的上级栏目信息
        /// </summary>
        /// <param name="filterSysDocId"></param>
        /// <param name="sClassType"></param>
        /// <returns></returns>
        List<DictLib> GetAllSysDocMess(string filterSysDocId, string sClassType);
        string getAddrLayCodeById(string filterAddrId);
        /// <summary>
        /// 保存系统类别信息
        /// </summary>
        /// <param name="ms"></param>
        /// <returns></returns>
        List<string> DoSaveSysDocMess(MsSecondClass ms);
        /// <summary>
        /// 保存成功之后添加树节点信息
        string GetNodeId(string systemId);
        /// </summary>
        /// <param name="NodeId"></param>
        /// <returns></returns>
        string GetNodeLevelStruct(string NodeId);
        string GetSysDocId(string sNumber, string sClassType);
        /// <summary>
        /// 获取编辑页面信息
        /// </summary>
        /// <param name="SysDocId"></param>
        /// <param name="sClassType"></param>
        /// <returns></returns>
        MsSecondClass GetSecondClassMess(string SysDocId,string sClassType);
        /// <summary>
        /// 获取编号规则页面树节点名称
        /// </summary>
        /// <param name="sClassType"></param>
        /// <returns></returns>
        List<MsCodeRule> GetCodeRuleNodes(string sClassType);
        /// <summary>
        /// 保存编号规则信息
        /// </summary>
        /// <param name="ms"></param>
        /// <returns></returns>
        List<string> DoSaveCodeRuleMes(MsCodeRule ms);
        /// <summary>
        /// 更新和删除规则信息
        /// </summary>
        /// <param name="codeId"></param>
        /// <returns></returns>
        List<string> DoOperateCodeRule(string codeId);
        /// <summary>
        /// 获取规则名称信息
        /// </summary>
        /// <param name="codeId"></param>
        /// <returns></returns>
        MsCodeRule GetCodeRule(string codeId);
        /// <summary>
        /// 获取规则明细信息
        /// </summary>
        /// <param name="codeId"></param>
        /// <returns></returns>
        List<MsCodeRuleDetail> GetCodeRuleDetailMes(string codeId);
        /// <summary>
        /// 获取树第一层节点信息
        /// </summary>
        /// <param name="sClassType"></param>
        /// <returns></returns>
        string GetCodeRuleNodesMes(string sClassType);
        /// <summary>
        /// 删除文档编码规则表信息(doc_b8)
        /// </summary>
        /// <param name="Number"></param>
        /// <param name="codeId"></param>
        /// <returns></returns>
        List<string> DoOperateCodeManage(string Number,string codeId);
        /// <summary>
        /// 获取文档编码规则表信息
        /// </summary>
        /// <param name="sNumber"></param>
        /// <returns></returns>
        DataSet GetCodeManage(string codeId, string sNumber);

        /// <summary>
        /// 新增文件
        /// </summary>
        /// <param name="Ms"></param>
        /// <returns></returns>
        MsDocClass InsertDoc(MsDocClass Ms);

        /// <summary>
        /// 添加文件内容
        /// </summary>
        /// <param name="Ms"></param>
        /// <returns></returns>
        MsDocContentClass InsertDocContent(MsDocContentClass Ms, string presentId);

         /// <summary>
        /// 返回 当前人所拥有的文档权限
        /// </summary>
        /// <param name="sId">文件夹ID</param>
        /// <returns>00完全共享 ； 01只读共享；05未共享给当前人</returns>
        string GetShare(string sId);


        #region 返回文件夹下所有文件与下级文件夹信息
        DataSet GetFilesMess(MsSecondClass Ms);
        #endregion

        #region
        List<MsSecondClass> GetSysDocNodesXMLmanage(string FolderId, string sClassType, string sNodeTab);
        #endregion

        #region 根据条件返回系统文档下边 文件夹集合
        List<MsSecondClass> GetMsSecondItem(string sWhere);
        #endregion

        #region 根据一级类别编号规则 生成文档编号
        /// <summary>
        /// 根据一级类别编号规则 生成文档编号
        /// </summary>
        /// <param name="sClassType">文档一级类别</param>
        /// <returns>生成的文档编号</returns>
        string GetEncodRules(string sClassType, string FoldrCode);
        #endregion

        #region 删除文档
        bool DelSysDoc(MsDocClass Ms);
        #endregion

        #region
        /// </summary>
        /// <param name="sFiesId">文件ID串 </param>
        /// <param name="sWork">操作类型 Code复制/Shear剪切</param>
        /// <param name="sType">文件类型串 ,号分隔</param>
        /// <param name="sObjectID">要进行 粘贴的文件夹ID</param>
        /// <param name="sClassType">一级栏目类型</param>
        bool Fiesmove(string sFiesId, string sWork, string sType, string sObjectID, string sClassType);
        #endregion


        #region 文件检索
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sQueryFies">文件查询条件</param>
        /// <param name="sQueryFolder">文件夹查询条件</param>
        /// <returns></returns>
        DataSet GetFilesSearch(string sQuery);
        #endregion

        MsDocClass GetDoc(MsDocClass ms);

        string GetCodeRuleMes(string sClassType);

        int UpdateDoc(MsDocClass Ms);
    }
}
